import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/LoginSign/Login'
import Sign from '@/components/LoginSign/Sign';
import Password from '@/components/LoginSign/Password';
import DealPassword from '@/components/LoginSign/DealPassword';
import ChangePassword from '@/components/LoginSign/ChangePassword';
import NavBar from '@/components/Common/NavBar';
import Page from '@/components/Index.vue';
import Home from '@/components/Page/Home';
import ChiCang from '@/components/Page/ChiCang';
import GongGao from '@/components/Page/GongGao';
import User from '@/components/Page/User';
import ChongZhi from '@/components/Page/User/ChongZhi';
import BangDing from '@/components/Page/User/BangDing';
import TiXian from '@/components/Page/User/TiXian';
import TiXianInfo from '@/components/Page/User/TiXianInfo';
import JiaoYi from '@/components/Page/User/JiaoYi';
import JiaoYiInfo from '@/components/Page/User/JiaoYiInfo';
import ShouZhi from '@/components/Page/User/ShouZhi';
import My from '@/components/Page/User/My';
import Guize  from '@/components/Page/User/Guize';
import App from '@/App';


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    {
      path: '/sign',
      name: 'Sign',
      component: Sign
    },
    {
      path: '/password',
      name: 'Password',
      component: Password
    },
    {
      path: '/dealpassword',
      name: 'DealPassword',
      component: DealPassword
    },
    {
      path: '/changepassword',
      name: 'ChangePassword',
      component: ChangePassword
    },
    {
      path: '/NavBar',
      name: 'NavBar',
      component: NavBar
    },
    {
      path: '/Home',
      component: Page,

      children: [
        {
          path: '/',
          name: 'Home',
          meta: {
            keepAlive: true
          },
          component: Home
        },
        {
          path: '/ChiCang',
          name: 'ChiCang',
          component: ChiCang
        },
        {
          path: '/GongGao',
          name: 'GongGao',
          component: GongGao
        },
        {
          path: '/User',
          name: 'User',
          component: User,
        },
      ]
    },
    {
      // 子路由写在外边
      path: '/User',
      // 用根 APP.vue 的 router-view 渲染 
      component: App,
      children: [
        {
          path: 'ChongZhi',
          component: ChongZhi,
        },
        {
          path: 'BangDing',
          component: BangDing,
        },
        {
          path: 'TiXian',
          component: TiXian,
        },
        {
          path: 'TiXianInfo',
          component: TiXianInfo,
        },
        {
          path: 'JiaoYi',
          component: JiaoYi,
        },
        {
          path: 'JiaoYiInfo',
          component: JiaoYiInfo,
        },
        {
          path: 'ShouZhi',
          component: ShouZhi,
        },
        {
          path: 'My',
          component: My,
        },
        {
          path: 'Guize',
          component: Guize,
        }
      ]

    }
  ]
})
